package com.coin.exchange.gate.rest.stock;

import java.io.IOException;

import org.apache.http.HttpException;

public interface IStockRestApi {
	
	/**
	 * 获取所有系统支持的交易对
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String pairs() throws HttpException, IOException;
	
	/**
	 * 获取所有系统支持的交易市场的参数信息，包括交易费，最小下单量，价格精度等
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String marketinfo() throws HttpException, IOException;
	
	/**
	 * 获取所有系统支持的交易市场的详细行情和币种信息，包括币种名，市值，供应量，最新价格，涨跌趋势，价格曲线等
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String marketlist() throws HttpException, IOException;
		
	/**
	 * 获取系统支持的所有交易对的 最新，最高，最低 交易行情和交易量，每10秒钟更新
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String tickers() throws HttpException, IOException;
	
	/**
	 * 获取单项交易对的最新，最高，最低 交易行情和交易量，每10秒钟更新
	 * @param symbol
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String ticker(String symbol) throws HttpException, IOException;
	
	/**
	 * 获取市场深度（委托挂单），其中 asks 是委卖单, bids 是委买单
	 * @param symbol
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String orderBook(String symbol) throws HttpException, IOException;
	
	/**
	 * 获取最新80条历史成交记录
	 * @param symbol
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String tradeHistory(String symbol) throws HttpException, IOException;
		
	/**
	 * 获取帐号资金余额
	 * @param apiKey
	 * @param secretKey
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String balance(String apiKey, String secretKey) throws HttpException, IOException;
	
	/**
	 * 获取充值地址
	 * @param apiKey
	 * @param secretKey
	 * @param currency:币种 如(BTC, LTC)
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String depositAddress(String apiKey, String secretKey, String currency) throws HttpException, IOException;
	
	/**
	 * 获取充值提现历史
	 * @param apiKey
	 * @param secretKey
	 * @param startTime:起始UNIX时间
	 * @param endTime:终止UNIX时间
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String depositsWithdrawals(String apiKey, String secretKey, String startTime, String endTime) throws HttpException, IOException;
	
	/**
	 * 下单交易买入
	 * @param apiKey
	 * @param secretKey
	 * @param currencyPair:交易币种对(如ltc_btc,ltc_btc)
	 * @param rate:价格
	 * @param amount:交易量
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String buy(String apiKey, String secretKey, String currencyPair, String rate, String amount) throws HttpException, IOException;
	
	/**
	 * 下单交易卖出
	 * @param apiKey
	 * @param secretKey
	 * @param currencyPair:交易币种对(如ltc_btc,ltc_btc)
	 * @param rate:价格
	 * @param amount:交易量
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String sell(String apiKey, String secretKey, String currencyPair, String rate, String amount) throws HttpException, IOException;
	
	/**
	 * 取消下单
	 * @param apiKey
	 * @param secretKey
	 * @param orderNumber:下单单号
	 * @param currencyPair:交易币种对(如 ltc_btc)
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String cancelOrder(String apiKey, String secretKey, String orderNumber, String currencyPair) throws HttpException, IOException;
	
	/**
	 * 取消所有下单
	 * @param apiKey
	 * @param secretKey
	 * @param type:下单类型(0:卖出,1:买入,-1:不限制)
	 * @param currencyPair:交易币种对 (示例:ltc_btc)
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String cancelAllOrders(String apiKey, String secretKey, String type, String currencyPair) throws HttpException, IOException;
	
	/**
	 * 获取下单状态
	 * @param apiKey
	 * @param secretKey
	 * @param orderNumber:下单单号
	 * @param currencyPair:交易币种对(如:eth_btc)
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String getOrder(String apiKey, String secretKey, String orderNumber, String currencyPair) throws HttpException, IOException;
	
	/**
	 * 获取我的当前挂单列表
	 * @param apiKey
	 * @param secretKey
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String openOrders(String apiKey, String secretKey) throws HttpException, IOException;
	
	/**
	 * 获取我的24小时内成交记录
	 * @param apiKey
	 * @param secretKey
	 * @param currencyPair
	 * @param orderNumber
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String myTradeHistory(String apiKey, String secretKey, String currencyPair,String orderNumber) throws HttpException, IOException;
	
	/**
	 * 提现
	 * @param apiKey
	 * @param secretKey
	 * @param currency:提现币种(如:btc)
	 * @param amount:提现数量
	 * @param address:提现地址(如:1HkxtBAMrA3tP5ENnYY2CZortjZvFDH5Cs)
	 * @return
	 * @throws HttpException
	 * @throws IOException
	 */
	public String withdraw(String apiKey, String secretKey, String currency,String amount, String address) throws HttpException, IOException;

}
